import React,{Suspense} from 'react';
import logo from './logo.svg';
import  './App.css';
// import {useRoutes} from "react-router-dom"
import routes from "./router/routes"
import {Link} from "react-router-dom"
import useRouteWithGuard from "./hooks/useRouteWithGuard"
import LayoutBase from './components/Layout';
// {[appStyle.App,appStyle.bg].join(" ")}

function App() {
  let element=useRouteWithGuard({routes,tokenKey:"qf-token"})
  return (
    <div className="app">
      {/* <Link to="/login">登入</Link>
      <br/>
      <Link to="/home">主页</Link> */}
      <LayoutBase>
        <Suspense>
          {element}
        </Suspense>
      </LayoutBase>
    </div>
  );
}

export default App;
